<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.roadmap.struts.action.ActionConst"%>
<%@ page import="com.roadmap.cache.RdcSessionCache"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!-- define header including menus and logo -->
<% 
	String user_ssn_id = (String)request.getSession().getAttribute(ActionConst.Aspirant_Id_In_Session);
	String user_ssn_name = (String)request.getSession().getAttribute(ActionConst.Aspirant_Name_In_Session);
	RdcSessionCache sessionCache = (RdcSessionCache) request.getSession().getAttribute(ActionConst.RDC_SESSION_CACHE_NAME);
	int noticeCount = 0;
	int msgCount = 0;
	int reqCount = 0;
	if(sessionCache != null) {
		noticeCount = sessionCache.getNoticeCount();
	 	msgCount = sessionCache.getMessageCount();
	 	reqCount = sessionCache.getRequestCount();
	}
%>
<head>
<link href="res/images/RDIcon.ico" rel="Shortcut Icon"/>
</head>
<div id="header-small">
	<div id="logo-small"></div>
	<div id="menu2">
		<div class="menu2-width1">
			<ul>
				<li><a href="home.do">首页</a></li>
				<li><a href="aspirant.do?uid=<%=user_ssn_id%>">个人主页</a></li>
				<li><a href="vision.do?act=view&uid=<%=user_ssn_id%>">我的人生</a></li>
				<li><a href="friend.do?act=view&uid=<%=user_ssn_id%>">好友</a></li>
				<li><a href="message.do?act=all">消息</a></li>
				<%
					if(noticeCount > 0 || msgCount > 0 || reqCount > 0) {
						out.print("<li id='notice'><img src='res/images/logo/sona.gif'/>&nbsp;");
						if(msgCount > 0) {
							out.print("<a href='message.do?act=all'><strong>" + msgCount + "</strong>条新短消息</a>&nbsp;");
						}
						if(noticeCount > 0) {
							out.print("<a href='notice.do'><strong>" + noticeCount + "</strong>条新通知</a>&nbsp;");
						}
						if(reqCount > 0) {
							out.print("<a href='request.do?act=all'><strong>" + reqCount + "</strong>条新请求</a>&nbsp;");
						}
						out.print("</li>");
					}
				%>
			</ul>
		</div>

		<div class="menu2-width2">
			<ul>
				<li><a href="aspirant.do?uid=<%=user_ssn_id%>"><%=user_ssn_name%></a></li>
				<li><a href="admin/reset.jsp">设置</a></li>
				<li><a href="logoff.do">退出</a></li>
			</ul>
		</div>
	</div>
</div>